{extend name="base" /}
{block name="content"}
<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="{:url('index/welcome')}"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>cms</span>
            <span class="icon-angle-right"></span>
            <span>管理栏目</span>
            <span class="icon-angle-right"></span>
            <span>栏目管理</span>
            <span class="icon-angle-right"></span>
            <span>{$info ? '编辑' : '添加'}栏目</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <div class="m-tab-tit clearfix">
                <ul>
                    <li class="item-act"><a href="javascript:;">基本属性</a></li>
                    <li><a href="javascript:;">选项设置</a></li>
                </ul>
            </div>
            <div class="m-form mt-10">
                <form class="layui-form" id="j_form">
                    <div class="m-tab-con">
                        <table class="m-table">
                            <thead>
                                <tr>
                                    <th colspan="2">基本属性</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td width="15%"><label for="name">栏目名称<em>*</em></label></td>
                                    <td><input type="text" class="u-ipt u-ipt-long" name="name" id="name" placeholder="请输入栏目名称" value="{$info.name}" /></td>
                                </tr>
                                <tr>
                                    <td><label for="alias_name">栏目别名</label></td>
                                    <td><input type="text" class="u-ipt u-ipt-long" name="alias_name" id="alias_name" placeholder="请输入栏目别名" value="{$info.alias_name}" /></td>
                                </tr>
                                <tr>
                                    <td><label for="">父级栏目</label></td>
                                    <td>
                                        <div class="lay-select m-select-def">
                                            <select name="parent_id">
                                                <option value="0">根栏目</option>
                                                {foreach name="columns" item="v"}
                                                <option value="{$v.id}"{if condition="$v['is_last']"} disabled{/if}{if condition="$info['parent_id'] eq $v['id']"} selected{/if}>{$v.html|html_entity_decode}|-{$v.name}</option>
                                                {/foreach}
                                            </select>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><label for="">所属系统模型<em>*</em></label></td>
                                    <td>
                                        <div class="lay-select m-select-def">
                                            <select name="mod_id">
                                                <option value="0">请选择系统模型</option>
                                                {foreach name="mods" item="mod"}
                                                <option value="{$mod.id}"{if condition="$info['mod_id'] eq $mod['id']"} selected{/if}>{$mod.name}</option>
                                                {/foreach}
                                            </select>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><label for="">是否终极栏目</label></td>
                                    <td>
                                        <input type="radio" name="is_last" value="1" title="是"{if condition="!$info || $info['is_last'] eq 1"} checked{/if} />
                                        <input type="radio" name="is_last" value="0" title="否"{if condition="$info && $info['is_last'] eq 0"} checked{/if} />
                                    </td>
                                </tr>
                                <tr>
                                    <td><label for="">栏目缩略图</label></td>
                                    <td>
                                        <button type="button" class="layui-btn u-upload-pic" data-name="image_id"><i class="layui-icon">&#xe67c;</i>上传图片</button>
                                        <div class="m-pic">
                                            <ul>
                                                {:attach_html($info.image_id, 'image_id')}
                                            </ul>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><label for="keywords">栏目关键词</label></td>
                                    <td><input type="text" class="u-ipt u-ipt-long" name="keywords" id="keywords" placeholder="请输入栏目关键词" value="{$info.keywords}" /></td>
                                </tr>
                                <tr>
                                    <td><label for="intro">栏目简介</label></td>
                                    <td><div class="m-textarea"><textarea name="intro" class="u-tarea" id="intro" placeholder="请输入栏目简介">{$info.intro}</textarea></div></td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="m-tab-con dn">
                        <table class="m-table">
                            <thead>
                                <tr>
                                    <th colspan="2">选项设置</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td width="15%"><label for="">栏目访问权限</label></td>
                                    <td><div class="lay-checked">{foreach name="roles" item="role"}<input type="checkbox" name="access_role_ids[]" value="{$role.id}" title="{$role.name}" lay-skin="primary"{if condition="strpos(','.$info['access_role_ids'].',', ','.$role['id'].',') !== false"} checked{/if} />{/foreach}</div></td>
                                </tr>
                                <tr>
                                    <td width="15%"><label for="">栏目下信息是否允许评论</label></td>
                                    <td><div class="lay-checked"><input type="checkbox" name="is_comment" value="1" title="允许" lay-skin="primary"{$info.is_comment ? ' checked' : ''} /></div></td>
                                </tr>
                                <tr>
                                    <td width="15%"><label for="">评论是否需要审核</label></td>
                                    <td><div class="lay-checked"><input type="checkbox" name="is_comment_checked" value="1" title="需要" lay-skin="primary"{$info.is_comment_checked ? ' checked' : ''} /></div></td>
                                </tr>
                                <tr>
                                    <td width="15%"><label for="">栏目是否允许投稿</label></td>
                                    <td><div class="lay-checked"><input type="checkbox" name="is_post" value="1" title="允许" lay-skin="primary"{$info.is_post ? ' checked' : ''} /></div></td>
                                </tr>
                                <tr>
                                    <td width="15%"><label for="">投稿是否需要审核</label></td>
                                    <td><div class="lay-checked"><input type="checkbox" name="is_post_checked" value="1" title="需要" lay-skin="primary"{$info.is_post_checked ? ' checked' : ''} /></div></td>
                                </tr>
                                <tr>
                                    <td width="15%"><label for="">投稿权限</label></td>
                                    <td><div class="lay-checked">{foreach name="roles" item="role"}<input type="checkbox" name="post_role_ids[]" value="{$role.id}" title="{$role.name}" lay-skin="primary"{if condition="strpos(','.$info['post_role_ids'].',', ','.$role['id'].',') !== false"} checked{/if} />{/foreach}</div></td>
                                </tr>
                                <tr>
                                    <td><label for="qinfo_page">前台信息每页显示</label></td>
                                    <td><input type="text" class="u-ipt u-ipt-small" name="qinfo_page" id="qinfo_page" value="{$info.qinfo_page ?: config('site.default_home_limit')}" /><span>条记录</span></td>
                                </tr>
                                <tr>
                                    <td><label for="diy_browse_nums">栏目自定义访问量</label></td>
                                    <td><input type="text" class="u-ipt u-ipt-small" name="diy_browse_nums" id="diy_browse_nums" value="{$info.diy_browse_nums ?: 0}" /></td>
                                </tr>
                                <tr>
                                    <td><label for="actual_browse_nums">栏目实际访问量</label></td>
                                    <td><input type="text" class="u-ipt u-ipt-small" name="actual_browse_nums" id="actual_browse_nums" value="{$info.actual_browse_nums ?: 0}" readonly /><span>实际浏览量不可修改，只可查看。</span></td>
                                </tr>
                                <tr>
                                    <td><label for="list_order">排序</label></td>
                                    <td><input type="text" class="u-ipt u-ipt-tiny" name="list_order" id="list_order" placeholder="请输入排序值" value="{$info.list_order ?: 0}" /><span>值越大越排在前面</span></td>
                                </tr>
                                <tr>
                                    <td><label for="">选择模板</label></td>
                                    <td>
                                        <div class="lay-select m-select-longer">
                                            <select name="template">
                                                <option value="columns_index">默认栏目模板 - columns_index.html</option>
                                            </select>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="m-form-btn"><input type="hidden" name="origin_super_column_ids" value="{$info.super_column_ids}" /><input type="hidden" name="origin_sub_column_ids" value="{$info.sub_column_ids}" /><input type="hidden" name="id" value="{$info.id}"><button id="j_btn" class="u-btn">确定提交</button></div>
                </form>
            </div>
        </div>
    </div>
</div>
{/block}
{block name="extrajs"}
{include file="public:upload"/}
{/block}